import request from '@/utils/request'

// 获取角色列表
export const getRoleListApi = ({ page, limit, roleName }) => {
  return request.get(`/admin/acl/role/${page}/${limit}?roleName=${roleName}`)
}

// 根据角色获取菜单
export const toAssignApi = (roleId) => {
  return request.get(`/admin/acl/permission/toAssign/${roleId}`)
}

// 新增角色
export const addRoleApi = (data) => {
  return request.post(`/admin/acl/role/save`, data)
}

// 修改角色
export const updataRoleApi = (data) => {
  return request.put(`/admin/acl/role/update`, data)
}

// 删除角色
export const delRoleApi = (id) => {
  return request.delete(`/admin/acl/role/remove/${id}`)
}
